  

<?php

class AuthDao {

    var $connection;

    function AuthDao($connection) {
        $this->connection = $connection;
    }

    function authenticate($login, $pwd) {  
        $sql = "SELECT permissions FROM clir_user WHERE login=\"$login\"  and pwd=\"$pwd\""; 
        
        $r = $this->connection->querySingle($sql); 
        if ($r){
            return $r['permissions'];
        }
        return $r;
    }

}
